package itesm.coler.data;

//Abstract class DAOFactory
public abstract class DAOFactory {
	
	// List of DAO types supported by the factory
	public static final int MySQL= 1;
	public static final int GoogleCloudSQL = 2;

	// There will be a method for each DAO that can be created. 
   // The concrete factories will have to implement these methods.
	public abstract UserDAO getUserDAO();
	public abstract CourseDAO getCourseDAO();
	public abstract TeamDAO getTeamDAO();
    public abstract ProblemDAO getProblemDAO();
    public abstract WordDAO getWordDAO();
    public abstract SessionDAO getSessionDAO();
    public abstract MessageDAO getMessageDAO();

    public abstract MessageCategoryDAO getMessageCategoryDAO();
    public abstract MessageTypeDAO getMessageTypeDAO();


	
    public static DAOFactory getDAOFactory(int type) {	  
		    switch (type) {
		      case MySQL:
		    	  try {
		    		  return new MySQLDAOFactory();
		    	  }catch (Exception e) {
	//	    		  throw new DAOException(e.getMessage())
		    	  }	    	  
		      case GoogleCloudSQL: 
		          return new GoogleCloudSQLDAOFactory();      
		      default: 
		          return null;
		    }
		  }
    
    
		}